/**
 * 
 */
package com.wrsr.examsys.card.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wrsr.examsys.base.dao.BaseDao;
import com.wrsr.examsys.base.service.impl.BaseServiceImpl;
import com.wrsr.examsys.card.service.ReDiscussService;
import com.wrsr.examsys.domain.Discuss;
import com.wrsr.examsys.domain.ReDiscuss;

/**
 * @author <a href="mailto:2397431783@qq.com">wangruishun</a>
 *
 *         2015年5月8日
 */
@Service("reDiscussService")
public class ReDiscussServiceImpl extends BaseServiceImpl<ReDiscuss> implements
		ReDiscussService {

	@SuppressWarnings("rawtypes")
	@Override
	@Resource(name = "reDiscussDao")
	public void setDao(BaseDao dao) {
		super.setDao(dao);
	}
	public Integer studentGetMsgFromReDiscuss(String fromId){
		String hql="from ReDiscuss c where c.deleteFlag=? and state=? and c.toId=?";
		List<ReDiscuss> reDdiscusss=super.findEntityByHQL(hql, 1,0,fromId);
		if (reDdiscusss == null || reDdiscusss.isEmpty()) {
			return 0;
		} else {
			return reDdiscusss.size();
		}
	}
}
